//
//  initializer_list_demo.cpp
//  cpp_learn
//
//  Created by 李贺 on 2021/12/30.
//

#include "initializer_list_demo.hpp"


namespace initializer_demo {

struct Student {
    Student(initializer_list<int> arr): arr(arr) {
    }
    initializer_list<int> arr;
};


void test_initializer() {
    initializer_list<int> ll = {10,20,30};
    Student stu(ll);
    
    for (auto it = stu.arr.begin(); it != stu.arr.end(); ++it) {
        cout << *it << endl;
    }

}

}
